﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace NJL.WebUsers
{
    public partial class FriendCenter : BasePageVisitor
    {
        private readonly BLL.NJL_USER bllUser = new BLL.NJL_USER();
        private readonly BLL.NJL_NEWS bllNews = new BLL.NJL_NEWS();
        private readonly BLL.NJL_COMPANY bllCompany = new BLL.NJL_COMPANY();
        private readonly BLL.NJL_COMPANY_SERVICE bllService = new BLL.NJL_COMPANY_SERVICE();
        protected IList<Model.NJL_USER> LIST_USER_1;
        protected IList<Model.NJL_USER> LIST_USER_2;
        protected IList<Model.NJL_USER> LIST_USER_3;
        protected IList<Model.NJL_USER> LIST_USER_4;
        protected IList<Model.NJL_NEWS> LIST_NEWS_1;
        protected IList<Model.NJL_COMPANY> LIST_COMPANY_1;

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    //txtKeywords.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + bntTopcis.ClientID + "').click();return false;}} else {return true}; ");
                }
                LoadData();
                bind();
                base.LoadPageSeoInformation("乡村广场");
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message.ToString());
            }
        }

        private void LoadData()
        {
            //            
            LIST_USER_1 = bllUser.GetModelList(36, " NJL_SYS_BASE_ID='" + WEBSITE_CODE + "' AND TYPE_CODE='2' ", " ID DESC");            
            LIST_COMPANY_1 = bllCompany.GetModelList(10, " NJL_COMPANY.NJL_SYS_BASE_ID='" + WEBSITE_CODE + "' AND NJL_COMPANY.AUDIT_STATE=1 AND NJL_COMPANY.TYPE_CODE='1' ", " SERVICE_COUNT DESC");
            LIST_NEWS_1 = bllNews.GetModelList(10, " NJL_SYS_BASE_ID='" + WEBSITE_CODE + "'", " VISIT_COUNT DESC");

        }

        void bind()
        {
        }

        protected Model.NJL_PERSON GetPersonByUserID(string UserID)
        {
            return new BLL.NJL_PERSON().GetModelByUserId(UserID);
        }

        protected Model.NJL_USER GetUserByID(string UserID)
        {
            return new BLL.NJL_USER().GetModel(UserID);
        }

        protected void bntTopcis_Click(object sender, EventArgs e)
        {
            //Response.Redirect("~/SearchTopics.aspx?keywords=" + txtKeywords.Text.Trim());
        }

        protected void btnUser_Click(object sender, EventArgs e)
        {
            //Response.Redirect("~/SearchFriend.aspx?user=" + txtKeywords.Text.Trim());
        }
    }
}